package com.xyq.friend.controller.file;

import com.xyq.common.core.controller.BaseController;
import com.xyq.common.core.domain.Result;
import com.xyq.common.file.domain.OSSResult;
import com.xyq.friend.aspect.CheckStatus;
import com.xyq.friend.service.file.FileService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;

@RequestMapping("/file")
@RestController
public class FileController extends BaseController {
    @Autowired
    private FileService fileService ;
    @CheckStatus

    @PostMapping("/upload")
    public Result<OSSResult> upload(@RequestBody MultipartFile file){
        return Result.success(fileService.upload(file));
    }

}
